package com.design.iterator;

public class Client {
    public static void main(String[] args) {
        ClassRoom classroom=new ClassRoom(3);
        classroom.addStudent(new Student("张三"));
        classroom.addStudent(new Student("李四"));
        classroom.addStudent(new Student("王五"));
        TIerator iterator = classroom.ierator();
        while (iterator.hasNext()){
            Student next = (Student) iterator.next();
            System.out.println(next.getName());
        }
    }

}
